package org.example.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;



/*public class UserController {
    @RequestMapping("/add")
    public String add(int a,int b) {
         String s=String.valueOf(a+b);
         return "a="+a+";b="+b+";s="+s;
    }
}*/


//@PathVariable提取参数
/*
public class UserController {
    @RequestMapping("/sub/{param1}/{param2}")
    public String sub(@PathVariable("param1")int a, @PathVariable("param2")int b) {
        */
/*String t=String.valueOf(a);
        String s=String.valueOf(b);*//*

        String s=String.valueOf(a-b);

        return s;

    }
}s
*/
//@RequestParam


import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @RequestMapping("mul")
    public String mul(@RequestParam("a") int a,@RequestParam("b") int b) {
        String s=String.valueOf(a*b);
        return s;
    }
}
